import type {BasicColumn, FormSchema} from '@/components/Table'
import {useRender} from '@/components/Table'

export const columns: BasicColumn[] = [
  {
    title: '交易日期',
    dataIndex: 'tradeDate',
    width: 160,
    customRender: ({text}) => {
      return useRender.renderDate(text, 'YYYY-MM-DD')
    }
  },
  {
    title: '已反映的入金业务-备付金账户已入金金额-本期系统反映',
    width: 160,
    children: [
      {
        title: '业务系统中贷记客户资金账户金额',
        dataIndex: 'a01',
        width: 160
      },
      {
        title: '手续费收入（支出）',
        dataIndex: 'a02',
        width: 160
      },
      {
        title: '其它',
        dataIndex: 'a03',
        width: 160
      }
    ]
  },
  {
    title: '已反映的入金业务-备付金账户已入金金额-前期系统反映',
    width: 160,
    children: [
      {
        title: '业务系统中贷记客户资金账户金额',
        dataIndex: 'a04',
        width: 160
      },
      {
        title: '手续费收入（支出）',
        dataIndex: 'a05',
        width: 160
      },
      {
        title: '其他',
        dataIndex: 'a06',
        width: 160
      }
    ]
  },
  {
    title: '已反映的入金业务-应收入金业务金额',
    width: 160,
    children: [
      {
        title: '本期业务系统中已贷记客户资金账户金额',
        dataIndex: 'a07',
        width: 160
      },
      {
        title: '本期手续费收入(支出)',
        dataIndex: 'a08',
        width: 160
      },
      {
        title: '其它',
        dataIndex: 'a09',
        width: 160
      }
    ]
  },
  {
    title: '未反映但备付金账户已收到款项',
    width: 160,
    children: [
      {
        title: '本期收到的金额',
        dataIndex: 'a10',
        width: 160
      },
      {
        title: '当期处理-补入账-业务系统中贷记客户资金账户金额',
        dataIndex: 'a11',
        width: 160
      },
      {
        title: '当期处理-补入账-手续费收入（支出）',
        dataIndex: 'a12',
        width: 160
      },
      {
        title: '当期处理-补入账-其他',
        dataIndex: 'a13',
        width: 160
      },
      {
        title: '当期处理-退回',
        dataIndex: 'a14',
        width: 160
      }
    ]
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 180,
    customRender: ({text}) => {
      return useRender.renderDate(text)
    }
  },
]

export const searchFormSchema: FormSchema[] = [
  {
    label: '交易日期',
    field: 'tradeDate',
    component: 'RangePicker',
    colProps: {span: 8}
  },
]

export const createFormSchema: FormSchema[] = [
  {
    label: '编号',
    field: 'id',
    show: false,
    component: 'Input'
  },
  {
    label: '交易日期',
    field: 'tradeDate',
    component: 'DatePicker',
    required: true,
    labelWidth: 400,
    componentProps: {
      showTime: false,
      format: 'YYYY-MM-DD',
      valueFormat: 'x',
    }
  },
  {
    label: '本期-业务系统中贷记客户资金账户金额（a01）',
    field: 'a01',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '本期-手续费收入（支出）（a02）',
    field: 'a02',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '本期-其它（a03）',
    field: 'a03',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '前期-业务系统中贷记客户资金账户金额（a04）',
    field: 'a04',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '前期-手续费收入（支出）（a05）',
    field: 'a05',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '前期-其他（a06）',
    field: 'a06',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '应收-本期业务系统中已贷记客户资金账户金额（a07）',
    field: 'a07',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '应收-本期手续费收入(支出)（a08）',
    field: 'a08',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '应收-其它（a09）',
    field: 'a09',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '本期收到的金额（a10）',
    field: 'a10',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '补入账-业务系统中贷记客户资金账户金额（a11）',
    field: 'a11',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '补入账-手续费收入（支出）（a12）',
    field: 'a12',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '补入账-其他（a13）',
    field: 'a13',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '退回（a14）',
    field: 'a14',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
]

export const updateFormSchema: FormSchema[] = [
  {
    label: '编号',
    field: 'id',
    show: false,
    component: 'Input'
  },
  {
    label: '交易日期',
    field: 'tradeDate',
    component: 'DatePicker',
    required: true,
    labelWidth: 400,
    componentProps: {
      showTime: false,
      format: 'YYYY-MM-DD',
      valueFormat: 'x',
    }
  },
  {
    label: '本期-业务系统中贷记客户资金账户金额',
    field: 'a01',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '本期-手续费收入（支出）',
    field: 'a02',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '本期-其它',
    field: 'a03',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '前期-业务系统中贷记客户资金账户金额',
    field: 'a04',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '前期-手续费收入（支出）',
    field: 'a05',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '前期-其他',
    field: 'a06',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '应收-本期业务系统中已贷记客户资金账户金额',
    field: 'a07',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '应收-本期手续费收入(支出)',
    field: 'a08',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '应收-其它',
    field: 'a09',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '本期收到的金额',
    field: 'a10',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '补入账-业务系统中贷记客户资金账户金额',
    field: 'a11',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '补入账-手续费收入（支出）',
    field: 'a12',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '补入账-其他',
    field: 'a13',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '退回',
    field: 'a14',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
]
